/**
 * Created by CK on 2016/7/4.
 */
$(document).ready(function(){
    var schoolId = xhTool.getQuery('iSchoolId');
    var groupId  = xhTool.getQuery('iSAGId');
    var list = $('#List');
    var btnModal = $(window.top.document).find('#bt_modal_confirm');
    list.initDataGrid('getOutGroupUserDgData', {"queryParams": {"iSchoolId": schoolId, "iSAGId": groupId, "iUserType": 4}});
    btnModal.addClass('disabled');
    DataGrid.onSelect = function(rowIndex,rowData){
        btnModal.removeClass('disabled');
    };
    btnModal.click(function(){
        var ids = list.getDataGridSelectedFields('iUserId');
        $.post(baseUrl + 'School/contactGroupUser', {ids: ids, iSchoolId: schoolId, iSAGId: groupId},function(result){
            window.top.xhTop.showMessage(result);
        });
    });
});